﻿<UserControl 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"  
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:sales="clr-namespace:Marking.Dashboard.Views.Sales" 
    x:Class="Marking.Dashboard.Views.Sales.SalesView"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles/Style.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Style="{StaticResource H2ContainerStyle}">
            <TextBlock Text="销售走势" Style="{StaticResource H2TextStyle}"/>
            <sales:CycleSearchView DataContext="{Binding CycleSearchViewModel}"/>
            <HyperlinkButton VerticalAlignment="Center" FontSize="15"
                    Command="{Binding LoadSalesInfosCommand}" 
                    CommandParameter="布匹">销售布匹统计</HyperlinkButton>
            <TextBlock Text="|" VerticalAlignment="Center" FontSize="15"/>
            <HyperlinkButton VerticalAlignment="Center" FontSize="15"  x:Name="MoneyButton"
                    Command="{Binding LoadSalesInfosCommand}" 
                    CommandParameter="金额">销售收款统计</HyperlinkButton>
        </StackPanel>

        <sales:SalesLineChartView Grid.Row="1" 
            DataContext="{Binding SalesLineChartViewModel, Mode=TwoWay}"
            SalesInfoClick="SalesLineChartView_SalesInfoClick"
            ReportUrl="{Binding ReportUrl}"/>
    </Grid>
</UserControl>
